import fetch from '@/utils/fetch'
// 显示所有课程
export const GetTable = (page, per_page = 20, keyword) => {
  return fetch({
    url: '/api/staff/courses',
    method: 'get',
    params: {
      page,
      per_page,
      keyword
    }
  })
}
// 删除课程
export const Delete = (id) => {
  return fetch({
    url: `/api/staff/courses/${id}`,
    method: 'delete'
  })
}
// 显示指定课程
export const Show = (id) => {
  return fetch({
    url: `/api/staff/courses/${id}`,
    method: 'get'
  })
}
// 更新课程
export const Update = (id, data) => {
  return fetch({
    url: `/api/staff/courses/${id}`,
    method: 'put',
    data
  })
}

// 添加课程
export const Create = (data) => {
  return fetch({
    url: `/api/staff/courses`,
    method: 'post',
    params: data
  })
}
